import request from '@/utils/request'

// 创建热门商品
export function createHotProducts(data) {
  return request({
    url: '/system/hot-products/create',
    method: 'post',
    data: data
  })
}

// 更新热门商品
export function updateHotProducts(data) {
  return request({
    url: '/system/hot-products/update',
    method: 'put',
    data: data
  })
}

// 删除热门商品
export function deleteHotProducts(id) {
  return request({
    url: '/system/hot-products/delete?id=' + id,
    method: 'delete'
  })
}

// 获得热门商品
export function getHotProducts(id) {
  return request({
    url: '/system/hot-products/get?id=' + id,
    method: 'get'
  })
}

// 获得热门商品分页
export function getHotProductsPage(params) {
  return request({
    url: '/system/hot-products/page',
    method: 'post',
    data: params
  })
}
// 导出热门商品 Excel
export function exportHotProductsExcel(params) {
  return request({
    url: '/system/hot-products/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
